package cn.fsd.feignclients;

import cn.fsd.domain.Customer;
import cn.fsd.domain.Customer_address;
import cn.fsd.domain.Order;
import cn.fsd.vo.ResultBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "customer-server",url = "localhost:1010")
public interface CustomerFeignClient {

  @GetMapping("/order/getOrderById")
  Order getTheOrder(@RequestParam("orderId") String orderId);

  @RequestMapping(value = "/order/changeOrderStatus/{order_id}/{status}",method = RequestMethod.POST)
  ResultBean changeOrderStatus(@PathVariable String order_id, @PathVariable String status);

  @RequestMapping(value = "/customer/getCustomerById", method = RequestMethod.GET)
  Customer getCustomerById(@RequestParam("id") String id);

  @RequestMapping(value = "/customer/getAddressByIdChoice/{id}/{choice}", method = RequestMethod.GET)
  Customer_address getAddressByIdChoice(@PathVariable("id") String id,@PathVariable("choice") Integer choice);
}
